import { GLoadedButton } from "../../../../../com/mui/controls/GLoadedButton";
import { ResFileConst } from "../../../resource/ResFileConst";
import { ObjCreate } from "../ObjCreate";
import { GTextFormat } from "../../../../common/GTextFormat";
import { FontUtil } from "../../../../common/font/FontUtil";
import { LoaderHelp } from "../../../../common/display/LoaderHelp";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../../resource/ImagesConst";
import { Language } from "../../../../../extend/language/Language";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
type int = number;
//class IntegralShopButton
    
    export  class IntegralShopButton extends GLoadedButton
    {
        constructor(arg1: int)
        {
            super();
            this._type = arg1;
            this.init();
            this.setSize(120, 46);
            return;
        }

        /* internal  */init(): void
        {
            this.styleName = ResFileConst.IntegralShopBtn;
            this._btnName = new Object /* flash.display.Bitmap */();
            this._btnName.x = 25;
            this._btnName.y = 10;
            addChild(this._btnName);
            label = "";
            this._labelTxt = ObjCreate.createGTextField("", 0, 15, 103, 30, this, new GTextFormat(FontUtil.songtiName, 14, 15788607, null, null, null, null, null, flash.text.TextFieldAutoSize.CENTER, null, null, 5));
            LoaderHelp.addResCallBack(ResFileConst.IntegralShop, this.onLoadedHandler);
            return;
        }

        /* internal  */onLoadedHandler(): void
        {
            if (this._type != 1) 
            {
                this._btnName.bitmapData = GlobalClass.getBitmapData(ImagesConst.ISShopBtnName1);
            }
            else 
            {
                this._btnName.bitmapData = GlobalClass.getBitmapData(ImagesConst.ISShopBtnName0);
            }
            return;
        }

        public updateButtonName(arg1: int): void
        {
            var loc1="";
            if (this._type != 1) 
            {
                if (this._type == 2) 
                {
                    if (arg1 != 0) 
                    {
                        if (arg1 != 1) 
                        {
                            if (arg1 == 2) 
                            {
                                loc1 = Language.getString(35054);
                            }
                        }
                        else 
                        {
                            loc1 = Language.getString(35044);
                        }
                    }
                    else 
                    {
                        loc1 = Language.getString(35043);
                    }
                }
            }
            else if (arg1 != 0) 
            {
                if (arg1 != 1) 
                {
                    if (arg1 == 2) 
                    {
                        loc1 = Language.getString(35053);
                    }
                }
                else 
                {
                    loc1 = Language.getString(35042);
                }
            }
            else 
            {
                loc1 = Language.getString(35041);
            }
            this._labelTxt.text = loc1;
            return;
        }

        /* internal */ /* var */_labelTxt: GTextFiled;

        /* internal */ /* var */_type: int;

        /* internal */ /* var */_btnName: Object /* flash.display.Bitmap */;
    }
